﻿@inherits BasePage
@page "/Menu/List"

<TableGroup>
    <Table TItem="MenuTree" @ref="table" ShowLoading=true IsBordered="true" HeaderStyle="@TableHeaderStyle.Light"
           ShowToolbar="true" ShowExtendButtons="true" ShowSkeleton="true" IsStriped="true"
           OnQueryAsync="@OnQueryAsync" OnSaveAsync="@OnSaveAsync"
           OnDeleteAsync="@OnDeleteAsync" IsTree="true" TreeNodeConverter="TreeNodeConverter">
        <TableColumns>
            <TableColumn @bind-Field="@context.Name" Width="360" />
            <TableColumn @bind-Field="@context.Code" Width="150" />
            <TableColumn @bind-Field="@context.Rotue" Width="180" />
            <TableColumn @bind-Field="@context.Icon" Width="200" />
            <TableColumn @bind-Field="@context.DisplayOrder" Width="180" />
            <TableColumn @bind-Field="@context.IsEnabled" ComponentType="@typeof(Switch)" />
        </TableColumns>
        <RowButtonTemplate Context="obj">
            @if (string.IsNullOrWhiteSpace(obj.Rotue))
                    {
            <TableCellButtonItem Item="obj" Icon="fa fa-info-circle" Text="新增子菜单" OnClickWithoutRenderItem="CreateChildrenMenu"></TableCellButtonItem>
                    }
                    else
                    {
            <TableCellButtonItem Item="obj" Icon="fa fa-info-circle" Text="权限管理" OnClickWithoutRenderItem="CreatePermission"></TableCellButtonItem>
                    }
        </RowButtonTemplate>
    </Table>
</TableGroup>

@code {


}

